//
//  YTPostArticle.m
//  yitaicaijing
//
//  Created by DIANGHONG on 2018/9/17.
//  Copyright © 2018年 DIANGHONG. All rights reserved.
//

#import "YTPostArticle.h"

@implementation YTPostArticle
- (NSString *)description
{
    return [self yy_modelDescription];
}

- (void)setPost_title:(NSString *)post_title
{
    _post_title = post_title;
    
    NSMutableAttributedString * attributedString1 = [[NSMutableAttributedString alloc] initWithString:post_title];
    NSMutableParagraphStyle * paragraphStyle1 = [[NSMutableParagraphStyle alloc] init];
    [paragraphStyle1 setLineSpacing:4];
    [attributedString1 addAttribute:NSParagraphStyleAttributeName value:paragraphStyle1 range:NSMakeRange(0, [post_title length])];
    
    
    self.attrTitle = attributedString1.copy;
}

- (void)setPost_date:(NSString *)post_date
{
    //    formatter = [[NSDateFormatter alloc] init];
    //    formatter.dateFormat = @"yyyy-MM-dd HH:mm:ss";
    //    NSDate *date = [formatter dateFromString:post_date];
    //    formatter.dateFormat = @"yy-MM-dd";
    //    NSString *dateStr = [formatter stringFromDate:date];
    //
    _post_date = post_date;
    
    self.postDate = [NSString timestampSwitchTime:[NSString cTimestampFromString:post_date].integerValue
                                     andFormatter:@"yyyy-MM-dd HH:mm:ss"];
}

@end
